Repository navigation
Conversation
In btintel_bootloader_setup_tlv(), when the controller is already running operational firmware (ver->img_type == BTINTEL_IMG_OP, such as across a warm reboot or module reload), execution jumps to the finish: label and previously skipped btintel_configure_offload(). Move btintel_configure_offload() to finish: so offload callbacks are always registered. Additionally, set HCI_OFFLOAD_CODECS_ENABLED when 0xfc86 reports HFP/SCO offload support (preset[0] & 0x03) so local offload codecs are queried during hci_dev_open_sync(). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add HCI_OP_ENHANCED_ACCEPT_SYNC_CONN (0x043e) and hci_accept_sync() so incoming eSCO/SCO connections on sockets configured with BT_CODEC (data_path != 0) configure the controller data path (0x0c83) and accept the synchronous connection over the offloaded PCM/SSP transport instead of falling back to legacy HCI_OP_ACCEPT_SYNC_CONN_REQ (0x0429). Also allow setting BT_CODEC on listening SCO sockets and inherit codec settings onto accepted child sockets. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Enable DDC 0x0130 (0x3f: LC3, SCO, A2DP SBC/AAC, LE Audio vendor codec, and controller delay reporting) and DDC 0x0120 (0x0b: SCO, LE ISO, and A2DP offload use cases) via HCI_Intel_Write_DDC (0xfc8b) during btintel_configure_offload() so HCI_Read_Local_Supported_Codecs_v2 (0x100d) and HCI_Read_Local_Supported_Codec_Capabilities (0x100e) report all hardware offload codecs supported by operational firmware. Extend btintel_get_codec_config_data() to configure 16 kHz SCO presets (0x01) for non-CVSD SCO codecs and 48 kHz 16-bit stereo SSP offload (preset 0x22) for ACL and LE CIS/BIS links. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add BT_CODEC getsockopt and setsockopt support to BTPROTO_ISO (for HCI_TRANSPORT_LE_CIS and HCI_TRANSPORT_LE_BIS offload codecs such as LC3 and vendor LE Audio codecs) and BTPROTO_L2CAP (for HCI_TRANSPORT_ACL A2DP offload codecs such as Intel SBC 0x0002:0x0000 and AAC 0x0002:0x0002). Update hci_iso_setup_path() to configure the controller data path (0x0c83) and pass the offloaded data_path, codec ID, and vendor CID/VID to HCI_LE_Setup_ISO_Data_Path (0x206e) when offload is enabled. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Implement Microsoft HCI vendor extension (0xfc1e) subcommands 0x07..0x0b (HCI_VS_MSFT_Avdtp_Capabilities_Configuration, Avdtp_Open, Avdtp_Start, Avdtp_Suspend, and Avdtp_Close) when MSFT_FEATURE_MASK_AVDTP (BIT(10)) is advertised by the controller. During msft_do_open(), query subcommand 0x07 and register the controller's offloaded AVDTP Media Codec Service Capabilities (SBC 0x00 and MPEG-2,4 AAC 0x02) into hdev->local_codecs under HCI_TRANSPORT_ACL. When setsockopt(SOL_BLUETOOTH, BT_CODEC) is called on a BTPROTO_L2CAP socket, invoke msft_avdtp_open() to open and start hardware A2DP offload on the controller's SSP TDM interface, and automatically suspend and close the stream when the L2CAP channel is released. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Configure 8 kHz SSP PCM preset 0x00 in btintel_get_codec_config_data() for 8 kHz synchronous codecs (0x00 u-law, 0x01 A-law, 0x02 CVSD, 0x03 Transparent, and 0x04 Linear PCM) while keeping 16 kHz preset 0x01 for 0x05 mSBC. Update hci_enhanced_setup_sync() and hci_enhanced_accept_sync() to pass the requested over-the-air coding format ID for G.711 u-law (0x00) and A-law (0x01) connections instead of hardcoding CVSD (0x02). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Configure 16 kHz SSP offload preset 0x01 for LE CIS and BIS links in btintel_get_codec_config_data(). When setting up an offloaded LE Audio ISO data path (path != 0) with BT_CODEC_LC3 (0x06), populate the mandatory Bluetooth SIG LC3 LTV Codec_Specific_Configuration (Sampling_Frequency, Frame_Duration, and Octets_Per_Codec_Frame) derived from conn->iso_qos in hci_iso_setup_path() so the controller's hardware LC3 encoder and decoder accept HCI_LE_Setup_ISO_Data_Path (0x206e). Also propagate the listening socket's BT_CODEC configuration onto hcon->codec in iso_conn_ready() so incoming CIS Peripheral connections configure the offloaded SSP data path as well. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This series enables full Bluetooth SSP (
SSP2-BT,Data_Path_ID = 0x01) hardware and Transparent-mode audio offload across HFP/eSCO (BTPROTO_SCO), LE Audio CIS/BIS (BTPROTO_ISO), and A2DP (BTPROTO_L2CAP) on Intel Bluetooth controllers paired with Sound Open Firmware (SOF) DSPs:Bluetooth: btintel: configure offload on operational boot(dc45683418df):btintel_configure_offload()when booting directly in operational firmware state (BTINTEL_IMG_OP) and setsHCI_OFFLOAD_CODECS_ENABLEDsoBT_CODECsocket discovery is active immediately.Bluetooth: sco: support Enhanced Accept Synchronous Connection(743e0b03a5c0):HCI_OP_ENHANCED_ACCEPT_SYNC_CONN(0x043e) andhci_accept_sync()so incoming eSCO/SCO connections onBT_CODEC-configured sockets configure the controller data path (0x0c83) and accept synchronous links overSSP2-BTinstead of legacy HCI PCM.Bluetooth: btintel: enable DDC offload codecs and ACL/ISO paths(b1336bc95213):0x0130(0x3f) and0x0120(0x0b) via0xfc8bduringbtintel_configure_offload()so0x100d/0x100eexpose SCO, LE Audio ISO, and A2DP offload capabilities, and configures SSP presets inbtintel_get_codec_config_data().Bluetooth: iso, l2cap: support BT_CODEC offload and data path(198a7de7a83d):BT_CODECgetsockopt()/setsockopt()discovery and selection onBTPROTO_ISO(HCI_TRANSPORT_LE_CIS/LE_BIS) andBTPROTO_L2CAP(HCI_TRANSPORT_ACL), and updateshci_iso_setup_path()to configure0x0c83and0x206e(HCI_LE_Setup_ISO_Data_Path) for offloaded ISO streams.Bluetooth: msft: support AVDTP A2DP hardware offload over SSP(c9028e599d53):0xfc1e) subcommands0x07..0x0b(Avdtp_Capabilities_Configuration,Avdtp_Open,Avdtp_Start,Avdtp_Suspend,Avdtp_Close) whenMSFT_FEATURE_MASK_AVDTP(BIT(10)) is advertised, registering offloaded SBC (0x00) and AAC (0x02) capabilities underHCI_TRANSPORT_ACLand managing stream lifecycle onBTPROTO_L2CAPsockets.Bluetooth: hci_conn, btintel: support u-law and A-law SCO offload(2e0ede4f3900):0x00for0x00(G.711 u-law),0x01(G.711 A-law),0x02(CVSD),0x03(Transparent), and0x04(Linear PCM), and passes the selected coding format ID inhci_enhanced_setup_sync()andhci_enhanced_accept_sync().Bluetooth: hci_conn, iso, btintel: support LE CIS LC3 SSP offload(55bbf62a067b):0x01forCIS_LINK/BIS_LINK, populates Bluetooth SIG LC3 LTVCodec_Specific_Configuration(Sampling_Frequency,Frame_Duration,Octets_Per_Codec_Frame) inhci_iso_setup_path()when offloadingBT_CODEC_LC3(0x06), and propagatesBT_CODEContohcon->codeciniso_conn_ready()for CIS Peripheral offload.Hardware Validation (Over-the-Air DSP-to-DSP
SSP2-BThw:0,20)Validated bi-directionally (
500 HzTX on Wildcat Lakeladybird[ibt-1190-01a1-pci] ↔1000 HzTX on Panther Lakedamsel-fly[ibt-00a0-0041-pci] and Arrow Lakedragon-fly[BE200]):ladybirdRX FFT (1000 HzTX)damsel-flyRX FFT (500 HzTX)BTPROTO_L2CAP)SBC (0x00)(48 kHz 2ch)999.97 Hz(RMS 14119.6)499.35 Hz(RMS 14135.0)BTPROTO_L2CAP)AAC (0x02)(48 kHz 2ch)1000.08 Hz(RMS 13707.5)500.57 Hz(RMS 13727.3)BTPROTO_SCO)mSBC (0x05)(16 kHz 1ch)999.90 Hz(RMS 14142.7)500.08 Hz(RMS 14123.5)BTPROTO_SCO)CVSD (0x02)(8 kHz 1ch)1000.14 Hz(RMS 10833.2)499.37 Hz(RMS 13668.5)BTPROTO_SCO)G.711 u-law (0x00)(8 kHz 1ch)1000.00 Hz(RMS 14006.2)499.86 Hz(RMS 14177.9)BTPROTO_SCO)G.711 A-law (0x01)(8 kHz 1ch)1000.29 Hz(RMS 14098.8)500.57 Hz(RMS 14261.1)BTPROTO_SCO)Transparent (0x03)Raw PCM + SOF DSP (LC3,mSBC,G.722,aptX)999.77..1000.45 Hz(RMS >14100)499.86..500.08 Hz(RMS >14100)BTPROTO_ISO)LC3 (0x06)(16 kHz 1ch)1000.03 Hz(RMS 15343.7)499.89 Hz(RMS 15503.1)